<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0, user-scalable=0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
    <style>
        #box{
            border: 20px black solid;
            background-color: black;
            width: 200px;
            height: 200px;
        }
        p{
            color: #fff;
        }
    </style>
</head>
<body>

    <div id="box">
        <p>鼠标移入样式改变，鼠标移出样式恢复</p>
    </div>
</body>
<script>
    window.onload = function(){
        var oDiv = document.getElementById('box')
        var op = document.getElementsByTagName("p")[0]
        oDiv.onmouseover = function(){
            this.style.cssText = "border-color:blue;background:red;sursor:crosshair";
            op.style.cssText = "color:blue"
        }
        oDiv.onmouseout = function(){
            this.style.cssText = "";
            op.style.cssText = "";
        }
    }
</script>
</html>